package com.qingcheng.controller;


import com.qingcheng.entity.Result;
import com.qingcheng.pojo.system.AdminInfo;
import com.qingcheng.service.AdminInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admininfo")
public class AdminInfoController {

    @Autowired
    private AdminInfoService adminInfoService;

    @GetMapping("/findByParentId")
    public Result findByParentId(Integer parentId){
        List<AdminInfo> list = adminInfoService.findByParentId(parentId);
        return new Result(200,"查询成功",list.get(0));
    }
}
